home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1998 / MacHack 1998.toast / Sessions / Completions / Completions Source / Sequencer / TaskSequencer.h < prev    next >
Encoding:
Text File  |  1998-06-17  |  1002 b   |  54 lines  |  [TEXT/CWIE]

  1. // TaskSequencer.h
  2.  
  3. #ifndef TaskSequencer_h
  4. #define TaskSequencer_h
  5.  
  6. #ifndef Task_h
  7. #include "Task.h"
  8. #endif
  9. #ifndef TaskStep_h
  10. #include "TaskStep.h"
  11. #endif
  12. #ifndef TaskLife_h
  13. #include "TaskLife.h"
  14. #endif
  15.  
  16. template < class Sequence >
  17. class TaskSequencer: private Task
  18.   {
  19.     public:
  20.         typedef TaskStep<Sequence> Step;
  21.         typedef TaskSequencer<Sequence> Sequencer;
  22.         
  23.     private:
  24.         Sequence& sequence;
  25.         Step step;
  26.         bool dying;
  27.         
  28.         BoundMethod1< Sequencer, DeferredTaskTime > deferredCompletor;
  29.         BoundMethod1< Sequencer, ApplicationTime > applicationCompletor;
  30.         BoundMethod1< Sequencer, DeferredTaskTime > finishingCompletor;
  31.         
  32.         TaskLife life;
  33.         
  34.         void LaunchStep();
  35.  
  36.         virtual void Launch();
  37.         virtual void Kill();
  38.         
  39.         void DeferredCompletor( DeferredTaskTime );
  40.         void ApplicationCompletor( ApplicationTime );
  41.         void FinishingCompletor( DeferredTaskTime );
  42.     
  43.     public:
  44.         TaskSequencer( Sequence& );
  45.         
  46.         Task *Start( Step );
  47.   };
  48.  
  49. #ifndef TaskSequencer_cp
  50. #include "TaskSequencer.cp"
  51. #endif
  52.  
  53. #endif
  54.